package com.yp.infrastructure.axon.model;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.SuperBuilder;
import org.axonframework.modelling.command.TargetAggregateIdentifier;

import java.util.UUID;


@Data
@EqualsAndHashCode(callSuper = true)
@SuperBuilder(toBuilder = true)
public abstract class BaseAxonCommand extends BaseAxonModel {

    @TargetAggregateIdentifier
    private String id;
    public BaseAxonCommand() {
        this.id = UUID.randomUUID().toString();
    }

    public BaseAxonCommand(String id) {
        this.id = id;
    }

}
